package cn.bfay.lion.jingdong.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 商品优惠信息.
 *
 * @author wangjiannan
 */
@FeignClient(url = "https://wq.jd.com", name = "jdProductDiscountClient", configuration = JdProductClientConfiguration.class)
public interface JdProductDiscountClient {
    /**
     * 促销.
     *
     * @param referer referer
     * @param skuid   skuid,多个用逗号分隔
     * @return string
     */
    @GetMapping(value = "/commodity/promo/get")
    String getPromotionContent(@RequestHeader(name = "referer") String referer,
                               @RequestParam(name = "skuid") String skuid);

    /**
     * 优惠券.
     *
     * @param referer  referer
     * @param platform platform
     * @param cid      cid
     * @param sku      sku 只支持单个商品
     * @param popId    popId
     * @return string
     */
    @GetMapping(value = "/bases/couponsoa/avlCoupon")
    String getCouponContent(@RequestHeader(name = "referer") String referer,
                            @RequestParam(name = "platform") String platform,
                            @RequestParam(name = "cid") String cid,
                            @RequestParam(name = "sku") String sku,
                            @RequestParam(name = "popId") String popId);
}
